1. Field of the Invention
The present invention relates to a signal recording and/or reproduction device that records and/or reproduces encoded data unequal length for a recording medium such as a semiconductor memory and so forth.
2. Brief Description of Relevant Art
FIG. 8 shows one example of an encoding device of the prior art which does not employ an unequal length encoding system.
In FIG. 8, an analog tone signal is A/D converted with an A/D (analog/digital) converter 101 into a digital signal and arranged for every fixed sample number of data and outputted, for frame processing. This data is frequency-analyzed with a frequency analyzer 102 and separated into signals of, for example, two bands frequency bands.
Each frequency analyzed band signal is fed to a scale factor computer 103 or 109 which determines each scale factor for quantization, and is fed to a scale factor quantizer 104 or 110. At the scale factor quantizer 104 or 110, each of the above mentioned scale factors is quantized with a fixed number of the bits and sent to either a scale factor dequantizer 105 or 111, or a multiplexer 107. At the scale factor dequantizer 105 or 111, each of the quantized scale factors are dequantized. These dequantized values are each fed to quantizers 106 or 108 while also being fed to a quantized bit count determiner 112, and the bit count for the quantization of each band signal is determined. These bit counts are fed to the quantizers 106 or 108, and depending on each of the dequantized scale factors and bit counts, the data of the two band signals from the above mentioned frequency analyzer 102 is quantized and outputted to the multiplexer 107. At the multiplexer 107, the quantized data and quantized scale factor of each band is multiplexed and fed to the error correction code adder 120. At the error correction code adder 120, the error correction codes are added, and the bit stream data is outputted to a transfer line of a determined bit rate or to a recording and reproducing system such as a digital audio tape DAT recorder.
Next, FIG. 9 shows an example of a decoding device of the prior art which does not employ an unequal length encoding system.
In the decoding device shown in FIG. 9, bit stream data which is output from the above-described encoding device and drawn through the transfer line or reproduced from a DAT or the like is inputted to an error correction restorer 220, and error correction processing is done according to error correction codes for each fixed amount of data. This error correction processed bit stream data is divided into quantized data and quantized scale factors of each of the above mentioned bands by a demultiplexer 201. The quantized scale factors for each of the above mentioned bands are each dequantized with scale factor dequantizers 204 and 207, and are sent to either of dequantizers 202 and 206 and quantized bit count determiner 208. At the quantized bit count determiner 208, the quantized bit counts for each of the above-mentioned bands are determined and outputted to their respective dequantizers 202 and 206. At the dequantizers 202 and 206, the quantized data for each of the above-mentioned bands is dequantized according to the dequantized scale factors and quantized bit counts for each band. The dequantized data of each band is then synthesized by a frequency synthesizer 203, and D/A (digital/analog) converted with the D/A converter 205 and outputted.
Next, a case where an unequal length manner is applied to the above-mentioned encoding and decoding system will be discussed. This unequal length encoding, also called variable length encoding, is an encoding process which makes allocation by changing the length of a code which is allocated according to the probability of occurrence of the data. That is, a shorter code is allocated for a higher probability of occurrence, and a longer code is allocated for a lower probability of occurrence, presenting a method for encoding which makes an average code length short and efficiently. The Huffman code is representative of such a method.
Generally, data is converted into a statistical model, such as a Gaussian distribution or Laplacian distribution model. Therefore, for data of such distribution, shorter codes are allocated for data of lower, amplitude, since the probability of occurrence is higher at lower amplitude, and longer codes are allocated for data of higher amplitude, since the probability of occurrence is lower at higher amplitude.
FIG. 10 shows an encoder of an encoding device which applies an unequal length encoding system according to the prior art, and FIG. 11 shows a decoding device also according to the prior art.
Concerning the encoding device shown in FIG. 10, the configuration of the A/D converter 301, the frequency analyzer 302, scale factor computers 307 and 312, scale factor quantizers 308 and 313, scale factor dequantizers 309 and 314 and quantizers 303 and 310, which are responsible for processing of A/D conversion, frequency analysis, determining of scale factor and quantized bit counts for each band, as well as the configuration and action of each band data until its quantization, is the same as that of the encoding device in the above FIG. 8, and an explanation thereof will therefore be omitted. The data of each band which was quantized by quantizers 303 and 310 are inputted to unequal length encoders 304 and 311 and are encoded in an unequal manner. This data is then inputted to a multiplexer 305. Thus the bit stream data outputted from the multiplexer 305 becomes the bit count of unequal lengths for each frame. This bit stream data is stored in a buffer 306, converted into fixed bit rate data and fed to an error correction code adder 320. At the error correction code adder 320, an error correction code is added to each group of fixed data, and it is outputted to a fixed bit rate transfer line or a recording and reproduction system such as a DAT or the like.
Next, concerning the decoding device shown in FIG. 11, the bit stream data which was obtained from the transfer line or DAT or the like is inputted to an error correction restorer 420, and error correction processing is done according to codes for error correction for each amount of fixed data. Since this error corrected bit stream data becomes the unequal length bit count for each frame, it is stored in a buffer 401. This bit stream data is divided into main data and scale factors by a multiplexer 402. The data of each band is then inputted to unequal length code decoders 403 and 408 for decoding, and fed to dequantizers 404 and 409. Processing at scale factor dequantizers 407 and 410, a quantized bit count determiner 411, a frequency synthesizer 405 and a D/A converter 406 are the same as that of the decoding device in FIG. 9, and an explanation thereof will therefore be omitted.
Incidentally, in a recording and reproducing device of the prior art which employs unequal length encoding as shown in the above-described FIGS. 10 and 11, the bit rate for transfer or recording is fixed, and hence a buffer is established in order to record/reproduce in real time. That is, the state of the buffer at any given time is: EQU B(n)=B(n-1)+Bin(n)-Bout(n) [bits] (1)
In this equation (1), n represents the n.sup.th memory update cycle of the buffer, B (n) represents the amount of data stored in the buffer, Bin (n) represents the amount of data inputted to the buffer and Bout (n) represents the amount of data outputted from the buffer. Bin (n) of this equation is of an unequal length, while Bout (n) is fixed. In such a situation, problems occur. That is, when, for example, a long code is allocated in a concentrated fashion, a so-called overflow condition results in which the amount of data B (n) input into the buffer exceeds the capacity of the buffer Bmax (B (n)&gt;Bmax), whereas when a shorter code is allocated in a concentrated fashion, a so-called underflow condition results in which feeding from the buffer or recording ceases (B (n)&lt;0).
The solution according to the prior art involves such measures as:
(a) allocation of a large memory capacity in the buffer; and PA1 (b) value change of the scale factors for quantization in a direction which inhibits overflow or underflow, in cases where such an occurrence is foreseen.
In the above measure (b), the state of the buffer is observed, and when an overflow seems likely to occur, the scale factor is increased and the signal to be quantized is decreased. Since a shorter code is allocated for a signal of lower amplitude, it is possible to prevent an overflow. When an underflow seems likely to occur, the scale factor is decreased and the signal to be quantized is increased. Since a longer code is allocated for a signal of higher amplitude, it is possible to prevent an underflow.
Both measures have their disadvantages, as in the first (a), in order to have a large buffer capacity, it is necessary to increase the magnitude of the hardware, and in the second (b), in order to manipulate the scale factor, desired characteristics become unattainable.
Incidentally, in recent years and in the future, the use of semiconductor memory has been and is being considered as a recording medium. Concretely, devices are being conceived which record/reproduce an audio signal, and so forth, using a so-called IC memory card. This type of signal recording or reproduction device which uses an IC memory card, and so forth, has many advantages in that it requires no movable parts, allows high-speed access and is easily miniaturized, and represents a very promising recording medium if memory capacity increase and cost reduction can be achieved. When using a semiconductor memory of an IC memory card, and so forth, as a recording medium, it would be desirable to employ a powerful unequal length encoding system from the point of view of increasing compression efficiency.
In a recording and/or reproduction device capable of recording and reproducing in real time utilizing a semiconductor memory as its recording and reproduction package medium, when unequal length encoding is employed as an encoding method, we propose utilization of the fact that, due to the lack of movable parts, there is no need to write/read at a fixed speed, and control of the time or speed of writing/reading according to the bit count per frame, which will render a buffer, as well as measures against the above mentioned overflow and underflow, unnecessary.
In cases which employ such technology, however, due to the fact that the bit rate of writing/reading for each frame is not fixed, it becomes necessary when implementing a random access to read the control signals of all the frames, and a time-loss thus occurs in situations where searching is made to each frame unit over the entire range of the recording signal. Also, since the speed of writing/reading is not fixed, adding error correction codes for fixed amounts of data as in the prior art, as well as error correction restoration, becomes troublesome.
The present invention was developed in the light of these circumstances of the prior art, in order to provide a signal recording device and/or reproduction device, using a semiconductor memory as a recording medium, which does not require buffer processing when employing an unequal length encoding system, which requires no measures against overflow and underflow of the buffer, and allows instantaneous access to each frame unit and efficient adding of error correction codes.